@echo off
setlocal

set "build_dir=build"

if exist "%build_dir%" (
    echo Cleaning build directory...
    pushd "%build_dir%"
    for /d %%i in (*) do (
        rd /s /q "%%i"
    )
    del /f /q *
    popd
    rd /s /q "%build_dir%"
    if not exist "%build_dir%" (
        echo Build directory cleaned successfully.
    ) else (
        echo Failed to clean build directory.
    )
) else (
    echo Build directory not found.
)